<include file="public@header" />
</head>
<body>
<div class="layui-fluid">
	<div class="layui-row">
		<div class="layui-page-header">
			<div class="layui-card">
				<div class="layui-page-header-content">
					<div class="layui-card-body">
						<div class="layui-ui-page-header-title" >
							{:lang('ADMIN_USER_INDEX')}<span class="layui-badge-rim page-content">网站管理员添加及管理</span>
						</div>
					</div>
					<div class="layui-tab layui-tab-brief">
						<ul class="layui-tab-title">
							<li class="layui-this"><a href="{:url('user/index')}">{:lang('ADMIN_USER_INDEX')}</a></li>
							<li><a href="javascript:admin.openIframeLayer('{:url('user/Add')}','{:lang('ADMIN_USER_ADD')}',{btn: ['保存','关闭'],area:['640px','50%'],end:function(){}});">{:lang('ADMIN_USER_ADD')}</a></li>
						</ul>
					</div>
				</div>
			</div>
		</div>
		<div class="layui-page-content">
			<div class="layui-card">
				<div class="layui-card-body">
					<form class="layui-form" method="get" action="{:url('User/index')}">
						<div class="layui-form-item layuiadmin-card-text" style="margin-bottom: 0;">
							<div class="layui-inline">
								<label class="layui-form-label">用户名</label>
								<div class="layui-input-inline">
									<input type="text" class="layui-input" name="user_login" value="{:input('request.user_login/s','')}" placeholder="请输入{:lang('USERNAME')}">
								</div>
							</div>
							<div class="layui-inline">
								<label class="layui-form-label">邮箱</label>
								<div class="layui-input-inline">
									<input type="text" class="layui-input" name="user_email" value="{:input('request.user_email/s','')}" placeholder="请输入{:lang('EMAIL')}">
								</div>
							</div>
							<div class="layui-inline">
								<div class="layui-input-inline">
									<input type="submit" class="layui-btn btn-primary" value="搜索" />
									<a class="layui-btn layui-btn-danger btn-danger" href="{:url('User/index')}">清空</a>
								</div>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
		<div class="layui-page-content">
			<div class="layui-card">
				<div class="layui-card-body">
					<table class="layui-table" lay-even lay-size="lg">
						<thead>
						<tr>
							<th width="50">ID</th>
							<th>{:lang('USERNAME')}</th>
							<th>{:lang('LAST_LOGIN_IP')}</th>
							<th>{:lang('LAST_LOGIN_TIME')}</th>
							<th>{:lang('EMAIL')}</th>
							<th>{:lang('STATUS')}</th>
							<th width="180">{:lang('ACTIONS')}</th>
						</tr>
						</thead>
						<tbody>
						<php>$user_statuses=array("0"=>lang('USER_STATUS_BLOCKED'),"1"=>lang('USER_STATUS_ACTIVATED'),"2"=>lang('USER_STATUS_UNVERIFIED'));</php>
						<foreach name="users" item="vo">
							<tr>
								<td>{$vo.id}</td>
								<td><if condition="$vo['user_url']"><a href="{$vo.user_url}" target="_blank" title="{$vo.signature}">{$vo.user_login}</a><else />{$vo.user_login}</if></td>
								<td>{$vo.last_login_ip}</td>
								<td>
									<if condition="$vo['last_login_time'] eq 0">
										{:lang('USER_HAVE_NOT_LOGIN')}
										<else />
										{:date('Y-m-d H:i:s',$vo['last_login_time'])}
									</if>
								</td>
								<td>{$vo.user_email}</td>
								<td>
									<switch name="vo.user_status">
										<case value="0">
											<span class="layui-badge-dot layui-bg-abnormal" style="margin-right: 6px;"></span>{$user_statuses[$vo['user_status']]}
										</case>
										<case value="1">
											<span class="layui-badge-dot layui-bg-function" style="margin-right: 6px;"></span>{$user_statuses[$vo['user_status']]}
										</case>
										<case value="2">
											<span class="layui-badge-dot layui-bg-default" style="margin-right: 6px;"></span>{$user_statuses[$vo['user_status']]}
										</case>
									</switch>
								</td>
								<td>
									<if condition="$vo['id'] eq 1 || $vo['id'] eq cmf_get_current_admin_id()">
										<if condition="$vo['user_status'] eq 1">
											<span class="layui-bo layui-bo-small layui-bo-primary layui-btn-disabled">{:lang('BLOCK_USER')}</span>
											<else />
											<span class="layui-bo layui-bo-small layui-bo-primary layui-btn-disabled">{:lang('ACTIVATE_USER')}</span>
										</if>
										<span class="layui-bo layui-bo-small layui-bo-primary layui-btn-disabled">{:lang('EDIT')}</span>
										<span class="layui-bo layui-bo-small layui-bo-primary layui-btn-disabled">{:lang('DELETE')}</span>
										<else />
										<if condition="$vo['user_status'] eq 1">
											<a class="layui-bo layui-bo-small layui-bo-waring js-ajax-dialog-btn" href="{:url('user/ban',array('id'=>$vo['id']))}" data-msg="{:lang('BLOCK_USER_CONFIRM_MESSAGE')}">{:lang('BLOCK_USER')}</a>
											<else />
											<a class="layui-bo layui-bo-small layui-bo-succes js-ajax-dialog-btn" href="{:url('user/cancelban',array('id'=>$vo['id']))}" data-msg="{:lang('ACTIVATE_USER_CONFIRM_MESSAGE')}">{:lang('ACTIVATE_USER')}</a>
										</if>
										<a class="layui-bo layui-bo-small layui-bo-checked" href="javascript:admin.openIframeLayer('{:url('user/edit',array('id'=>$vo['id']))}','编辑',{btn: ['保存','关闭'],area:['640px','50%'],end:function(){}});">{:lang('EDIT')}</a>
										<a class="layui-bo layui-bo-small layui-bo-close js-ajax-delete" href="{:url('user/delete',array('id'=>$vo['id']))}">{:lang('DELETE')}</a>
									</if>
								</td>
							</tr>
						</foreach>
						</tbody>
					</table>
					<div class="pagination">{$page}</div>
				</div>
			</div>
		</div>
	</div>
</div>
<include file="public@script"/>
</body>
</html>